
import { ApiProperty } from "@nestjs/swagger";
import { IsEmail, IsNotEmpty, IsOptional, IsString } from "class-validator";

export class LoginEmailDto {

  @ApiProperty({ name: '邮箱', example: '123@qq.com' })
  @IsNotEmpty({ message: '邮箱不能为空' })
  @IsEmail({}, { message: '邮箱格式不正确' })
  email: string;

  @ApiProperty({ description: "验证码", type: String })
  @IsNotEmpty({ message: "验证码不能为空" })
  code: string;


  @ApiProperty({ description: "openid", type: String })
  @IsString({ message: "openid必须是字符串" })
  @IsOptional()
  openid: string;
}
